package mytest;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

public class IteratorTest {

    public static void main(String[] args) {
        List<String> students = new ArrayList<>();

        students.add("zhangsan1");
        students.add("zhangsan2");
        students.add("zhangsan3");
        students.add("zhangsan4");
        students.add("zhangsan5");

//        Iterator iterator = students.iterator();
//        while (iterator.hasNext()) {
//            String student = String.valueOf(iterator.next());
//            if(student.equals("zhangsan3")) {
//                iterator.remove();
//            }
//        }
        for (Iterator iterator = students.iterator();iterator.hasNext();) {
            String student = String.valueOf(iterator.next());
            if(student.equals("zhangsan3")) {
                iterator.remove();
            }
        }
        for (String student : students) {
            System.out.println(student);
        }

        System.out.println("abc张三def1".contains("张三de"));

        Date now = new Date();

        Date date1 = new Date();
        date1.setTime(now.getTime() - 1000 * 65);
        double muti = (now.getTime() - date1.getTime()) /60 /60/1000;

        BigDecimal a =  new BigDecimal(now.getTime() - date1.getTime()).divide(new BigDecimal(60 *60*1000), 2, RoundingMode.FLOOR);
        System.out.println(a);

        System.out.println("sasaaaa".contains("sa"));

    }
}
